/***************************************************************************
 *   Copyright (C) 2008 by Eduardo Gurgel Pinho                            *
 *   edgurgel@gmail.com                                                    *
 *                                                                         *
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 3 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful,       *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of        *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the         *
 *   GNU General Public License for more details.                          *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc.,                                       *
 *   59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.             *
***************************************************************************/

#ifndef __COLOR_MATERIAL_H__
#define __COLOR_MATERIAL_H__

#include "object_material.h"

#include "common/color.h"

#include <boost/serialization/nvp.hpp>
#include <boost/serialization/version.hpp>

namespace Sirat {

namespace Material {

class Color_Material : public Object_Material {
public:
	Color_Material(const Common::Color& _ambient, const Common::Color& _diffuse, const Common::Color& _specular, const Common::Color& _reflectiveness, const double _brightness =0.0);
	Color_Material();
	Color_Material(const Color_Material& _material);
	~Color_Material();

	Common::Color get_ambient() const;
	Common::Color get_diffuse() const;
	Common::Color get_specular() const;
	Common::Color get_reflectiveness() const;
	double get_brightness() const;
	double get_refractive_index() const;

	void set_ambient(const Common::Color& _ambient);
	void set_diffuse(const Common::Color& _diffuse);
	void set_specular(const Common::Color& _specular);
	void set_reflectiveness(const Common::Color& _reflectiveness);
	void set_brightness(const double _brightness);
	void set_refractive_index(const double _refrective_index);

	Color_Material& operator=(const Color_Material& _color_material);

	Material* clone() { return new Color_Material(*this); }

private:
	friend class boost::serialization::access;
	template<class Archive> void serialize(Archive&, const unsigned int);

	Common::Color ambient;
	Common::Color diffuse;
	Common::Color specular;
	Common::Color reflectiveness;

	double brightness;
	double refractive_index;
};

template<class Archive> void Color_Material::serialize(Archive& ar, const unsigned int /* file_version */){
	ar  & BOOST_SERIALIZATION_BASE_OBJECT_NVP(Object_Material)
		& BOOST_SERIALIZATION_NVP(ambient)
		& BOOST_SERIALIZATION_NVP(diffuse)
		& BOOST_SERIALIZATION_NVP(specular)
		& BOOST_SERIALIZATION_NVP(reflectiveness)
		& BOOST_SERIALIZATION_NVP(brightness);
}

}

}

#endif
